body {
    font-family: 'Noto Serif', serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f5f1;
    color: #333;
}

header {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    text-align: center;
}

h1 {
    margin: 0;
    font-size: 2.5rem;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin-top: 1rem;
}

nav ul li {
    display: inline;
    margin-right: 15px;
}

nav ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: #f39c12;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    background-color: #34495e;
    color: #ecf0f1;
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 5px;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.book-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    list-style-type: none;
    padding: 0;
}

.book-item {
    background-color: #fff;
    border-radius: 5px;
    padding: 1rem;
    margin: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: calc(33.333% - 2rem);
    max-width: 250px;
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.book-item h3:hover{
	color: #f39c12;
}
.book-item div{
	overflow: hidden;
	width: 100%;
	height: 100%;
}
.book-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}
.book-item img:hover{
	transform: scale(1.11);
	transition: all .3s ease;
}
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 1rem;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero, .book-item {
    animation: fadeIn 1s ease-in-out;
}

/* Search input styles */
.search-input {
    padding: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    max-width: 300px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .book-list {
        flex-direction: column;
        align-items: center;
    }

    .book-item {
        width: 100%;
        max-width: 300px;
    }
}

document.addEventListener('DOMContentLoaded', () => {
    // Add a class to trigger animation when scrolling
    const bookItems = document.querySelectorAll('.book-item');
    
    const observer = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                entry.target.classList.add('animate');
            }
        });
    }, { threshold: 0.5 });

    bookItems.forEach(item => {
        observer.observe(item);
    });

    // Simple search functionality
    const searchInput = document.createElement('input');
    searchInput.type = 'text';
    searchInput.placeholder = 'Search books...';
    searchInput.classList.add('search-input');

    const headerNav = document.querySelector('header nav');
    headerNav.insertBefore(searchInput, headerNav.firstChild);

    searchInput.addEventListener('input', (e) => {
        const searchTerm = e.target.value.toLowerCase();
        bookItems.forEach(item => {
            const title = item.querySelector('h3').textContent.toLowerCase();
            const author = item.querySelector('p').textContent.toLowerCase();
            if (title.includes(searchTerm) || author.includes(searchTerm)) {
                item.style.display = 'block';
            } else {
                item.style.display = 'none';
            }
        });
    });
});

